import request from "@/utils/request";

export const treeselect = () => {
    request({
        url: "/system/dept/treeselect",
        method: "get",
    });
}

export const roleDeptTreeselect = (roleId) => {
    request({
        url: "/system/dept/roleDeptTreeselect/" + roleId,
        method: "get",
    });
}

export const listDept = (query) => {
    request({
        url: "/system/dept/list",
        method: "get",
        params: query,
    });
}
export const listDeptTable = (query) => {
    request({
        url: "/system/dept/listTable",
        method: "get",
        params: query,
    });
}

export const listDeptExcludeChild = (deptId) => {
    request({
        url: "/system/dept/list/exclude/" + deptId,
        method: "get",
    });
}

export const getDept = (deptId) => {
    request({
        url: "/system/dept/" + deptId,
        method: "get",
    });
}

export const delDept = (deptId) => {
    request({
        url: "/system/dept/" + deptId,
        method: "delete",
    });
}

export const updateDept = (data) => {
    request({
        url: "/system/dept",
        method: "put",
        data: data,
    });
}

export const addDept = (data) => {
    request({
        url: "/system/dept",
        method: "post",
        data: data,
    });
}
export const getOrganization = () => {
    request({
        url: "/system/dept/getOrganization",
    });
}
